package com.hqyj.lx.service.impl;

import com.hqyj.lx.dao.QuestionDao;
import com.hqyj.lx.pojo.Question;
import com.hqyj.lx.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/*
*
*   question业务
* */
@Service
public class QuestionServiceImpl implements QuestionService {

    @Autowired
    private QuestionDao questionDao;

    @Override
    public List<Question> queryAllQuestion() {
        List<Question> list = questionDao.queryAllQuestion();

        return list;
    }

    @Override
    public int insertOneQuestion(Question one) {
        return questionDao.insertOneQuestion(one);
    }

    @Override
    public int deleteOneQuestion(int quesId) {

        return questionDao.deleteOneQuestion(quesId);
    }

    @Override
    public int updateOneQuestion(Question question) {
        return questionDao.updateOneQuestion(question);
    }


    @Override
    public Question questionQueryById(int quesId) {
        return questionDao.questionQueryById(quesId);
    }
//通过courseName课程名查询数据
    @Override
    public List<Question> questionQueryByCourseName(String courseName) {
        return questionDao.questionQueryByCourseName(courseName);
    }

    @Override
    public List<Question> questionQueryByQuesType(String courseName,String quesType) {
        return questionDao.questionQueryByQuesType(courseName,quesType);
    }
}
